package com.peas.platform.module.icims.budget.archives.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 指标库
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_budget_kpi`")
public class BudgetKpiPo extends BasePo {

    // 指标来源
    // 1:页面创建，2:预算编制
    @Comment(value = "指标来源")
    @NotBlank(message = "指标来源不能为空")
    @Size(max = 20, message = "指标来源不能超过20个字符")
    @TableField(value = "`source`", jdbcType = JdbcType.VARCHAR)
    private String source;

    // 指标级别
    // 1:一级指标，2:二级指标，3:三级指标
    @Comment(value = "指标级别")
    @NotNull(message = "指标级别不能为空")
    @TableField(value = "`level`", jdbcType = JdbcType.INTEGER)
    private Integer level;

    // 指标编号
    @Comment(value = "指标编号")
    @Size(max = 50, message = "指标编号不能超过50个字符")
    @TableField(value = "`code`", jdbcType = JdbcType.VARCHAR)
    private String code;

    // 指标名称
    @Comment(value = "指标名称")
    @NotBlank(message = "指标名称不能为空")
    @Size(max = 200, message = "指标名称不能超过200个字符")
    @TableField(value = "`name`", jdbcType = JdbcType.VARCHAR)
    private String name;

    // 排序权重
    @Comment(value = "排序权重")
    @TableField(value = "`weight`", jdbcType = JdbcType.INTEGER)
    private Integer weight;

    // 上级指标ID
    // （指标库表）外键
    @Comment(value = "上级指标ID")
    @TableField(value = "`parent_id`", jdbcType = JdbcType.BIGINT)
    private Long parentId;

    // 状态
    // 1:有效，0:无效
    @Comment(value = "状态")
    @Size(max = 20, message = "状态不能超过20个字符")
    @TableField(value = "`state`", jdbcType = JdbcType.VARCHAR)
    private String state;

}
